<? include $_SERVER['DOCUMENT_ROOT'].'/fr/include/connexion.php'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Herbes de Chine</title>
		<link href="/fr/css/common.css" rel="stylesheet" type="text/css" />
		<link href="/fr/css/inside.css" rel="stylesheet" type="text/css" />
		<link href="/fr/css/admin.css" rel="stylesheet" type="text/css" />
	</head>
	<body>
		﻿<div id="header">
			<table id="top">
				<tr>
					<td id="logo" rowspan="2"><a href="/fr/index.php"><img src="/img/common/header/logo.gif" alt="Herbes de Chine" /></a></td>
					<td id="connexion"></td>
				</tr>
				<tr>
					<td id="cart"></td>
				</tr>
			</table>
		</div>
		<div id="tools">
			<table>
				<tr>
					<td id="title">Liste des commandes</td>
				<? include $_SERVER['DOCUMENT_ROOT']."/fr/admin/nav.php"; ?>
				</tr>
			</table>
		</div>
		<td id="search">
		    <table id="body" class="widescreen">
				<tr class="top"><td colspan="2"></td></tr>
			    <tr class="middle"><td class="content">
					<div id="form" class="double">
						<table class="clear">
							<?
							$_GET['sort'] = "com_date";
							$sortby = "ORDER BY `".$_GET['sort']."`";
							$sortby = $sortby." DESC";
							?>
							<tr><td colspan="2"><h2>Commandes en cours</h2></td></tr>
							<tr><td><table>
							<?
							$q1 = mysql_query("SELECT * FROM command WHERE com_statut = 'En cours de traitement' $sortby" );
							if(@mysql_num_rows($q1)>0){
								while ($r1 = mysql_fetch_array($q1) ){ ?>
									<tr><td class="ligne" width="250px"><a href="/fr/admin/com_cart.php?user_id=<? echo $r1['user_id']; ?>&cmd=<? echo $r1['com_id']; ?>"><strong><? echo $r1['com_id']."</a></strong></td><td>".$r1['user_id']."</td><td>".$r1['com_price']." € (".$r1['com_pay'].")</td><td>".$r1['com_date']."</td><td>".$r1['com_statut']; ?></td></tr>
							<? } 
							} else { ?>
								<tr><td colspan="2">Aucune commande en cours</td></tr>
							<? } ?>
							</table></td></tr>
							<tr><td colspan="2"><h2>Commandes terminées</h2></td></tr>
							<tr><td><table>
							<?
							$q1 = mysql_query("SELECT * FROM command WHERE com_statut != 'En cours de traitement' $sortby");
							if(@mysql_num_rows($q1)>0){
							while ($r1 = mysql_fetch_array($q1) ){ ?>
								<tr><td class="ligne" width="250px"><a href="/fr/admin/com_cart.php?user_id=<? echo $r1['user_id']; ?>&cmd=<? echo $r1['com_id']; ?>"><strong><? echo $r1['com_id']."</a></strong></td><td>".$r1['user_id']."</td><td>".$r1['com_price']." €</td><td>".$r1['com_date']."</td><td>".$r1['com_statut']; ?></td></tr>
							<? } 
							} else { ?>
								<tr><td colspan="2">Aucune commande terminée</td></tr>
							<? } ?>
							</table></td></tr>
							<tr><td colspan="2">&nbsp;</td></tr>
						</table>
						<div class="left">
							
						</div>
					</div>
				</td></tr>
				<tr class="bottom"><td colspan="2"></td></tr>
			</table>﻿
		</div>
	</body>
</html>
